import { getSysConfig, addSysConfig, editSysConfig, delSysConfig, getSysConfigSelect } from '../../api/sysConfig'
const sysConfig = {
    namespaced: true,
    state: {

    },
    getters: {

    },
    mutations: {

    },
    actions: {
        GetSysConfig({ state, commit, dispatch }, params) {
            return new Promise((resolve, reject) => {
                getSysConfig(params).then(res => {
                    resolve(res)
                }).catch(err => {
                    reject(err)
                })
            })
        },
        AddSysConfig({ state, commit, dispatch }, data) {
            return new Promise((resolve, reject) => {
                addSysConfig(data).then(res => {
                    resolve(res)
                })
            })
        },
        EditSysConfig({ state, commit, dispatch }, data) {
            return new Promise((resolve, reject) => {
                editSysConfig(data).then(res => {
                    resolve(res)
                })
            })
        },
        DelSysConfig({ state, commit, dispatch }, id) {
            return new Promise((resolve, reject) => {
                delSysConfig(id).then(res => {
                    resolve(res)
                })
            })
        },
        GetSysConfigSelect({ state, commit, dispatch }, params) {
            return new Promise((resolve, reject) => {
                getSysConfigSelect(params).then(res => {
                    resolve(res)
                })
            })
        }
        
    }
}

export default sysConfig
